/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package former.queryFormers;

import former.AbstractFormer;
import Tables.AbstractTable;
import java.nio.Buffer;

/**
 *
 * @author FOE
 */
public class InsertFormer extends AbstractFormer
{
    
    @Override
    public String formQuery(AbstractTable object)
    {
        boolean noError = initializeQuery(object);
        StringBuilder builder=new  StringBuilder();
        if(noError)
        {
            builder.append("insert into ");
            builder.append(getTableName());
            builder.append("(");
            builder.append(getTableCol());
            builder.append(") values (");
            for(int i=0;i<getDataList().size();i++)
            {
                if(i!=0)
                {
                    builder.append(" , ");
                }
                builder.append("?");
            }
            builder.append(")");
        }
        return builder.toString();
    }

    @Override
    protected String formQueryHelper(AbstractTable object) 
    {
        return null;
    }
    
    
}
